package github.sf.fw.tools.db.sql;


import github.sf.fw.utils.StrUtil;

import java.util.Objects;

public class ISqlUtils {
    static String SELECT_ALL = "select a_.* from {tableName}  a_ ";

    public static String selectAll(String tableName) {
        Objects.requireNonNull(tableName);
        return StrUtil.format(SELECT_ALL, tableName);
    }

    public static String selectAll(String databaseName, String tableName) {
        Objects.requireNonNull(databaseName);
        Objects.requireNonNull(tableName);
        tableName = databaseName + "." + tableName;
        return StrUtil.format(SELECT_ALL, tableName);
    }

    public static String concatName(String databaseName, String tableName) {
        Objects.requireNonNull(databaseName);
        Objects.requireNonNull(tableName);
        return databaseName + "." + tableName;
    }
}
